//@ sourceURL=SceneTaskManageForm.js
SceneTaskManageForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        SceneTaskManageForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/relatedparty/saveSceneTaskManage.do",
                items:[
                       {
                           id : "sceneTaskManage.id",
                           name : "sceneTaskManage.id",
                           xtype : "hidden",
                           value : this.id == null ? "": this.id
                       }, {
                           name : "sceneTaskManage.years",
                           xtype : "hidden",
                           id : "sceneTaskManage.years",
                           value : this.years == null ? "" : this.years
                       },{
                           layout:"column",
                           bodyStyle:"padding:5px;",
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               defaultType:"textfield",
                               border:false,
                               columnWidth:0.5,
                               items:[{
                                   fieldLabel: '所属机构', 
                                   name: 'sceneTaskManage.institution'
                               }]
                       },{
                           layout:'column',
                           bodyStyle:'padding:5px;',
                           columnWidth:.5,
                           border:false,
                           items:[{
                               columnWidth:.7,
                               layout:"form",
                               border:false,
                               items:[{
                                   xtype:"hidden",
                                   width:100,
                                   fieldLabel:'所属协议',
                                   name:'sceneTaskManage.relatedPartyProtocolId',
                                   allowBlank:true,
                                   maxLength:100
                               },{
                                   xtype:"textfield",
                                   width:100,
                                   fieldLabel:'所属协议<font color="red">*</font>',
                                   name:'sceneTaskManage.protocolName',
                                   allowBlank:false,
                                   maxLength:100
                               }]
                           },{
                               columnWidth:.3,
                               layout:"form",
                               border:false,
                               items:[{
                                   text:'选择',
                                   width:50,
                                   xtype:'button',
                                   handler:function(){
                                       SingleGridEject.getView({
                                           callback:function(records){
                                                var relatedPartyProtocolForm=yearGridFormPanel.getForm();
                                                relatedPartyProtocolForm.findField("sceneTaskManage.relatedPartyProtocolId").setValue(records[0].data.id);
                                                relatedPartyProtocolForm.findField("sceneTaskManage.protocolName").setValue(records[0].data.protocolName);
                                           },
                                           multiSel:false,
                                           select:true,
                                           winId:'RelatedPartyProtocolInfoWin',
                                           winTitle:'相关方协议查看',
                                           winWidth:700,
                                           winHeight:480,
                                           winListurl:__ctxPath + "/relatedparty/listRelatedPartyProtocol.do",
                                           winFields : [ "id",'years','institution','protocolNo', "protocolName", "relatedType", "relatedName","signDate","protocolValidity","protocolContent"],
                                           columnModel : [ {
                                                   header : "id",
                                                   dataIndex : "id",
                                                   hidden : true
                                               }, {
                                                   header : "年份",
                                                   dataIndex : "years",
                                                   width : 50,
                                                   hidden:true,
                                                   sortable : true
                                               }, {
                                                   header:"所属机构",
                                                   dataIndex:'institution',
                                                   width:100
                                               },{
                                                   header : "协议编号",
                                                   dataIndex : "protocolNo",
                                                   width : 100
                                               }, {
                                                   header : "协议名称",
                                                   dataIndex : "protocolName",
                                                   width : 70
                                               }, {
                                                   header : "相关方类型",
                                                   dataIndex : "relatedType",
                                                   width : 100
                                               }, {
                                                   header:"相关方名称",
                                                   dataIndex:"relatedName",
                                                   width:100
                                               }, {
                                                   header : "签订日期",
                                                   dataIndex : "signDate",
                                                   width : 70
                                               }, {
                                                   header : "协议有效期",
                                                   dataIndex : "protocolValidity",
                                                   width : 70
                                               }, {
                                                   header : "协议内容",
                                                   dataIndex : "protocolContent",
                                                   width : 70
                                               }]
                                       }).show();
                                   }
                               }]
                           }]
                       
                       },{
                          layout:"form",
                          columnWidth:.5,
                          border:false,
                          bodyStyle:"padding:5px;",
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:'项目名称'+'<font color=red>*</font>',
                              id:"sceneTaskManage.projectName",
                              name:"sceneTaskManage.projectName",
                             // maxLength:80,
                              allowBlank:false,
                              blankText:"项目名称不能为空！"
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"施工方",
                              id:"sceneTaskManage.constructionSide",
                              name:"sceneTaskManage.constructionSide",
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"安全责任人",
                              id:"sceneTaskManage.safePerson",
                              name:"sceneTaskManage.safePerson",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"检查机构",
                              id:"sceneTaskManage.checkAgency",
                              name:"sceneTaskManage.checkAgency",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"检查负责人",
                              id:"sceneTaskManage.checkPerson",
                              name:"sceneTaskManage.checkPerson",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      }]
                       },{
                   layout:"column",
                   bodyStyle:"padding:5px;",
                   items:[{
                       columnWidth:1.,//第一列 
                       layout:"form", 
                       bodyStyle:"padding:5px;",
                       items:[{ 
                           xtype:"textarea", 
                           fieldLabel: '参检人员', 
                           name: 'sceneTaskManage.participatePerson', 
                           width:448 
                           }] 
                  },{
                      columnWidth:1.,//第一列 
                      layout:"form", 
                      bodyStyle:"padding:5px;",
                      items:[{ 
                          xtype:"textarea", 
                          fieldLabel: '检查内容', 
                          name: 'sceneTaskManage.checkContent', 
                          width:448 
                          }] 
                 },{
                     columnWidth:1.,//第一列 
                     layout:"form", 
                     bodyStyle:"padding:5px;",
                     items:[{ 
                         xtype:"textarea", 
                         fieldLabel: '检查结论', 
                         name: 'sceneTaskManage.checkConclusion', 
                         width:448 
                         }] 
                },{
                    columnWidth:1.,//第一列 
                    layout:"form", 
                    bodyStyle:"padding:5px;",
                    items:[{ 
                        xtype:"textarea", 
                        fieldLabel: '备注', 
                        name: 'sceneTaskManage.remark', 
                        width:448 
                        }] 
               }]
               }]
            },
        loadData:{
            getUrl:__ctxPath +"/relatedparty/getSceneTaskManage.do",
            preName : "sceneTaskManage"
        },
        isShow:this.isShow
    });
}
});
